package com.yxj01;

import java.io.File;
import java.io.IOException;

public class FileDemo04 {
    public static void main(String[] args) throws IOException {
        //删除此路径的文件或者目录
        //public boolean delete();
        File f1 = new File("java.txt");
        System.out.println(f1.delete());
        System.out.println("-----------");

        //删除目录
        File f2 = new File("JavaSe");
        System.out.println(f2.delete());
        System.out.println("-----");
        //删除多级目录
        File f3 = new File("JavaWeb\\HTML");
        File f4 = new File("JavaWeb");
        System.out.println(f4.delete());
        System.out.println(f3.delete());
    }
}
